package com.kebabeaters.nakebab.client.event;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.event.shared.HasHandlers;

public class CircleMouseOverEvent extends
		GwtEvent<CircleMouseOverEvent.Handler> {

	private final boolean entered;

	public static interface Handler extends EventHandler {

		void onSelect(CircleMouseOverEvent event);
	}

	public interface HasCircleMouseOverHandler extends HasHandlers {
		HandlerRegistration addCircleMouseOverHandler(Handler handler);
	}

	public CircleMouseOverEvent(boolean entered) {
		this.entered = entered;
	}

	private static Type<CircleMouseOverEvent.Handler> TYPE;

	public static Type<CircleMouseOverEvent.Handler> getType() {
		if (TYPE == null) {
			TYPE = new Type<CircleMouseOverEvent.Handler>();
		}
		return TYPE;
	}

	@Override
	public final Type<CircleMouseOverEvent.Handler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(CircleMouseOverEvent.Handler handler) {
		handler.onSelect(this);
	}
	
	public boolean isEntered() {
		return entered;
	}
}
